package com.gitee.algorithm.test;

import com.gitee.algorithm.tree.BinaryTree;

public class DemoBinaryTree {
    public static void main(String[] args) {
        //创建二叉查找对象
        BinaryTree<Integer,String> stu=new BinaryTree<>();

        //测试插入
        stu.put(4,"猪八戒");
        stu.put(1,"孙悟空");
        stu.put(3,"唐三藏");
        stu.put(7,"白龙马");
        stu.put(10,"沙悟净");
//        System.out.println("此时树的个数是："+stu.size());
        System.out.println(stu.get(4));
        System.out.println(stu.get(10));

        //删除以后，键值对为10的的值为null
        stu.delate(10);
//        System.out.println("此时树的个数是："+stu.size());
        stu.delate(3);
//        System.out.println("此时树的个数是："+stu.size());
//        System.out.println(stu.min());
//        System.out.println(stu.max());
        System.out.println("--------------");
        System.out.println(stu.get(3));
        System.out.println(stu.get(10));
    }
}
